package org.travel.api.travel.controller.Chao;


import org.hibernate.validator.constraints.URL;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.travel.api.travel.dao.Chao.AreaDao;
import org.travel.api.travel.pojo.Area;

import java.util.List;

@Controller
@RequestMapping("/Area")
@CrossOrigin("*")
public class ChaoArea {

    @Autowired
    private AreaDao areaDao;

    @RequestMapping("/list")
    @ResponseBody
    public List<Area> list() throws Exception{
        List<Area> list = areaDao.findAll();
        return list;
    }


}
